home *** CD-ROM | disk | FTP | other *** search
/ Windows 6-Pak - Disc 4 / Windows 6-Pak (InfoMagic) (Disc 4) (1999).ISO / Text-Chat-Scripts / pp-320m.exe / pp300 / r-disp.mrc < prev    next >
Text File  |  1998-10-10  |  30KB  |  537 lines

  1. ; -----------------------------------------------------
  2. ; Peace and Protection (by misspai)
  3. ; -----------------------------------------------------
  4. ; Display-related events (involve
  5. ; improving/changing display of
  6. ; events/etc)
  7. ; -----------------------------------------------------
  8. ; Channel info 
  9. ; -----------------------------------------------------
  10. #_rawhalts off
  11. raw *:*:return
  12. #_rawhalts end
  13. #-voicesync off
  14. raw 353:*:halt
  15. raw 366:*:{
  16.   set %-vsync.update $remtok(%-vsync.update,$2,44)
  17.   if (%-vsync.update == $null) .disable #-voicesync
  18.   if ($2 ischan) {
  19.     sline -r $2 1
  20.     if (%+nickcolors) _updchcol $2
  21.   }
  22.   halt
  23. }
  24. #-voicesync end
  25. raw 324:*:{
  26.   if (%-invited. [ $+ [ $2 ] ] != $null) halt
  27.   if (%-joining > 0) {
  28.     if ($findtok(%-joinchans,$2,32) != $null) {
  29.       auto fpq $2 $me
  30.       set %-joinchans $remtok(%-joinchans,$2,32)
  31.     }
  32.     dec %-joining
  33.     inc %-joining2
  34.     halt
  35.   }
  36.   if ($2 isin %-cinfo.targ) {
  37.     disprs-div $2
  38.     disprs $2 [[ $+ %col.info1 $+ $lower($2) $+ ] channel info- %col.option $+ (CtrlF3 to list clones)
  39.     set %-cf3 clones $2
  40.     if ((%stricttopic. [ $+ [ $2 ] ] != $null) || (%strictmode. [ $+ [ $2 ] ] != $null) || (%onoptopic. [ $+ [ $2 ] ] != $null) || (%onopmode. [ $+ [ $2 ] ] != $null) || (%alonetopic. [ $+ [ $2 ] ] != $null) || (%alonemode. [ $+ [ $2 ] ] != $null)) disprs $2 [[ $+ %col.info1 $+ $lower($2) $+ ] has special strict modes/topics set. %col.option $+ (type /strictinfo to list them)
  41.   }
  42.   if ($3 == +) disprs $2 [[ $+ %col.info1 $+ $lower($2) $+ ] mode- %col.dark $+ (none)
  43.   else disprs $2 [[ $+ %col.info1 $+ $lower($2) $+ ] mode- %col.dark $+ $3-
  44.   halt
  45. }
  46. raw 328:*:disprs $2 [[ $+ %col.info1 $+ $lower($2) $+ ] url- %col.dark $+ $3- | halt
  47. raw 329:*:{
  48.   if (%-invited2. [ $+ [ $2 ] ] != $null) halt
  49.   if (%-joining2 > 0) { dec %-joining2 | halt }
  50.   disprs $2 [[ $+ %col.info1 $+ $lower($2) $+ ] formed- %col.dark $+ $asctime($3)
  51.   halt
  52. }
  53. raw 331:*:disprs $2 [[ $+ %col.info1 $+ $lower($2) $+ ] topic- %col.dark $+ (none) | unset %-namec.* | halt
  54. raw 332:*:disprs $2 [[ $+ %col.info1 $+ $lower($2) $+ ] topic- %col.dark $+ $3- | unset %-namec.* | halt
  55. raw 333:*:disprs $2 [[ $+ %col.info1 $+ $lower($2) $+ ] topic- set by %col.target $+ $3 $+  %col.dark $+ ( $+ $asctime($4) $+ ) | halt
  56. raw 353:*:{
  57.   if ($4 == $null) { set %-namec.ppl -1 | halt }
  58.   else { if (%-namec.ppl == 0) disprs-div $3 | inc %-namec.ppl $_numtok(32,$4-) | inc %-namec.ops $count($4-,@) | inc %-namec.voc $count($4-,+) }
  59.   if ((%-joining > 0) || (($3 isin %-cinfo.targ) && ($3 ischan))) halt
  60.   set %.nc.op %col.info3 $+ @ $+ %col.dark
  61.   set %.nc.voc %col.info3 $+ + $+ %col.dark
  62.   set %.nc.wrap $calc(%linewrap.names - $len($3) - 10)
  63.   if ((%linewrap.names > 0) && ($len($4-) > %.nc.wrap) && (%.nc.wrap > 15)) {
  64.     set %.nc.names $4-
  65.     :loop
  66.     if ($len(%.nc.names) <= %.nc.wrap) set %.nc.todo %.nc.names
  67.     else {
  68.       set %.nc.todo $left(%.nc.names,%.nc.wrap)
  69.       set %.nc.todo $_ltok($_j($_numtok(32,%.nc.todo)),32,%.nc.todo)
  70.     }
  71.     disprs $3 [[ $+ %col.info1 $+ $lower($3) $+ ] names- %col.dark $+ $replace($replace(%.nc.todo,@,%.nc.op),+,%.nc.voc)
  72.     set %.nc.names $remtok($remove(%.nc.names,%.nc.todo),!,32)
  73.     if (%.nc.names != $null) goto loop
  74.   }
  75.   else disprs $3 [[ $+ %col.info1 $+ $lower($3) $+ ] names- %col.dark $+ $replace($replace($4-,@,%.nc.op),+,%.nc.voc)
  76.   halt
  77. }
  78. raw 366:*:{
  79.   if (%-namec.ppl > 0) {
  80.     set %-namec.reg $calc(%-namec.ppl - %-namec.voc - %-namec.ops)
  81.     disprs $2 [[ $+ %col.info1 $+ $lower($2) $+ ] users- %col.dark $+  $+ %-namec.ppl $+  total $_plural(user,%-namec.ppl)
  82.     if (%-namec.voc > 0) disprs $2 [[ $+ %col.info1 $+ $lower($2) $+ ] users- %col.dark $+  $+ %-namec.ops $+  $_plural(op,%-namec.ops) %col.dark $+ ( $+ $_p(%-namec.ops,%-namec.ppl) $+ ) - %col.dark $+  $+ %-namec.voc $+  voiced %col.dark $+ ( $+ $_p(%-namec.voc,%-namec.ppl) $+ ) - %col.dark $+  $+ %-namec.reg $+  not op/voice %col.dark $+ ( $+ $_p(%-namec.reg,%-namec.ppl) $+ )
  83.     else disprs $2 [[ $+ %col.info1 $+ $lower($2) $+ ] users- %col.dark $+  $+ %-namec.ops $+  $_plural(op,%-namec.ops) %col.dark $+ ( $+ $_p(%-namec.ops,%-namec.ppl) $+ ) - %col.dark $+  $+ %-namec.reg $+  $_plural(nonop,%-namec.reg) %col.dark $+ ( $+ $_p(%-namec.reg,%-namec.ppl) $+ )
  84.     disprs-div $2
  85.   }
  86.   elseif (%-namec.ppl == -1) disps [[ $+ %col.info1 $+ $lower($2) $+ ] All users on channel are invisible.
  87.   else disps [[ $+ %col.info1 $+ $lower($2) $+ ] No users on channel, or channel is secret/private.
  88.   unset %-namec.*
  89.   if ($2 isin %-cinfo.targ) set %-cinfo.targ $remtok(%-cinfo.targ,$2,32)
  90.   if ($2 ischan) {
  91.     sline -r $2 1
  92.     if ((%-joining < 1) && (%+nickcolors)) _updchcol $2
  93.     elseif ($findtok(%-mirc.rejoins2,$2,32) != $null) {
  94.       set %-mirc.rejoins2 $remtok(%-mirc.rejoins2,$2,32)
  95.       if (%+nickcolors) _updchcol $2
  96.       set %.xw $_usebot($2,login) | if (%.xw != $null) _botcmd %.xw $2 $me
  97.       if (join isin %autobot. [ $+ [ $2 ] ] ) { set %.xw $_usebot($2,opme) | if (%.xw != $null) _botcmd %.xw $2 $me }
  98.     }
  99.     elseif ((%-joining > 0) && ($nick($2,0) == 1) && ($me isop $2) && ($right($2,2) != )) _dolonemode $2
  100.   }
  101.   halt
  102. }
  103. ; -----------------------------------------------------
  104. ; Server info
  105. ; -----------------------------------------------------
  106. raw 2:*:disps %col.serv $+ $2- | halt
  107. raw 3:*:disps %col.serv $+ $2- | halt
  108. raw 4:*:disps %col.serv $+ $2- | halt
  109. raw 250:*:disps %col.serv $+ $2- | halt
  110. raw 251:*:disps %col.serv $+ $2-3 $+  %col.info3 $+ $4 $+  %col.serv $+ $5-6 $+  %col.info3 $+ $7 $+  %col.serv $+ $8-9 $+  %col.att $+ $10 $+  %col.serv $+ $11- | halt
  111. raw 252:*:disps %col.info1 $+ $2 $+  %col.serv $+ $3- | halt
  112. raw 253:*:disps %col.info1 $+ $2 $+  %col.serv $+ $3- | halt
  113. raw 254:*:disps %col.info1 $+ $2 $+  %col.serv $+ $3- | halt
  114. raw 255:*:disps %col.serv $+ $2-3 $+  %col.info1 $+ $4 $+  %col.serv $+ $5-6 $+  %col.info1 $+ $7 $+  %col.serv $+ $8- | halt
  115. raw 256:*:disps %col.info2 $+ $2 $+  %col.serv $+ $3- | halt
  116. raw 257:*:disps %col.serv $+ $2- | halt
  117. raw 258:*:disps %col.serv $+ $2- | halt
  118. raw 259:*:disps %col.serv $+ $2- | halt
  119. raw 263:*:disps %col.serv $+ $2- | halt
  120. raw 265:*:disps %col.serv $+ $2- | halt
  121. raw 266:*:disps %col.serv $+ $2- | halt
  122. raw 351:*:disps %col.serv $+ $2- | halt
  123. #-servinfo off
  124. raw 371:*:disps - %col.serv $2- | halt
  125. #-servinfo end
  126. raw 371:*:disps %col.serv $+ Info for [[ $+ $server $+ ]] | .enable #-servinfo | disps - %col.serv $2- | halt
  127. raw 374:*end*info list*:disps ... %col.serv $+ End Info | .disable #-servinfo | halt
  128. raw 382:*:disps Rehashing: %col.target $+ $2 | halt
  129. ; -----------------------------------------------------
  130. ; User info
  131. ; -----------------------------------------------------
  132. raw 8:*:disps Your server notice mask is $_color(mode) $+ ,99 $+ $2 $7 | halt
  133. raw 221:*:if ($1 == $me) disps Your usermode is $_color(mode) $+ $2- | else disps Usermode of %col.target $+ $1 $+  is $_color(mode) $+ $2- | halt
  134. #-listsilence off
  135. raw 271:*:disps - %col.serv $+ $3- | halt
  136. #-listsilence end
  137. raw 271:*:disps %col.serv $+ Silence list for [[ $+ $1 $+ ]] | .enable #-listsilence | disps - %col.serv $+ $3- | halt
  138. raw 272:*end of silence list*:disps ... %col.serv $+ End Silence list | .disable #-listsilence | halt
  139. raw 381:*:disps   $2-   | halt
  140. ; -----------------------------------------------------
  141. ; Inviting users
  142. ; -----------------------------------------------------
  143. raw 341:*:{
  144.   if ($_ischan($2)) { set %.iv.chan $2 | set %.iv.nick $3 }
  145.   else { set %.iv.chan $3 | set %.iv.nick $2 }
  146.   disprs %.iv.chan [[ $+ %col.info1 $+ $lower(%.iv.chan) $+ ] Inviting %col.target $+ %.iv.nick $+  to %col.target $+ %.iv.chan
  147.   halt
  148. }
  149. raw 342:*summon*to irc*:disps Summoning %col.target $+ $2 $+  to IRC | halt
  150. ; -----------------------------------------------------
  151. ; Error replies
  152. ; -----------------------------------------------------
  153. raw 402:*no such server*:{
  154.   if (%-isnosuch. [ $+ [ $2 ] ] <= 0) disps No such server %col.target $+ $2
  155.   _timersinc 15 -isnosuch. $+ $2
  156.   halt
  157. }
  158. raw 407:*duplicate recipients*:disps Duplicate recipients for %col.target $+ $2 $+  (no message sent) | halt
  159. raw 408:*no such service*:disps No such service %col.target $+ $3
  160. raw 409:*no origin*:disps No origin specified for server PING or PONG | halt
  161. raw 411:*no recipient give*:disps $2-4 %col.info2 $+ $5- | halt
  162. raw 412:*no text*:disps No text given to send | halt
  163. raw 413:*no toplevel domain*:disps No toplevel domain given- %col.target $+ $2 | halt 
  164. raw 414:*wildcard in*domain*:disps Wildcard in toplevel domain- %col.target $+ $2 | halt 
  165. raw 416:*too many lines in*output*:disps Too much output for your %col.info2 $+ $2 $+  command, restrict request and try again | halt
  166. raw 421:*unknown command*:disps Unknown command- %col.info2 $+ $2 | halt
  167. raw 422:*motd file*:if ($nick != $server) disps Server error in retreiving Message of the day for %col.info2 $+ $nick | else disps Server error in retreiving Message of the day | halt
  168. raw 423:*no admin*info*:disps Server error in retreiving Administration info for %col.targ $+ $2 | halt
  169. raw 424:*file error*:disps Error at server- %col.att $+ $2- | halt
  170. raw 437:*nick*chan*temp*unavail*:{
  171.   if ($_ischan($2)) disprs $2 [[ $+ %col.info1 $+ $lower($2) $+ ] Channel is temporarily unavailable
  172.   else disps Nickname $2 is temporarily unavailable
  173. }
  174. raw 439:*target change too fast*:{
  175.   if ($_ischan($2)) set %.tc.pre [[ $+ %col.info1 $+ $lower($2) $+ ]
  176.   else unset %.tc.pre
  177.   if ($3 == Message) %.wait = $10 | else %.wait = $9
  178.   disprs $2 %.tc.pre anti-mass-message- You can't send info to %col.target $+ $2 $+  until waiting %col.info2 $+ %.wait $+  seconds.
  179.   if ($_ischan($2)) .timer929 1 %.wait disprs $2 %.tc.pre You may now speak in %col.target $+ $2
  180.   else .timer929 1 %.wait disprs $2 You may now speak to %col.target $+ $2
  181.   halt
  182. }
  183. raw 440:*:disps $2- | halt
  184. raw 444:*user not logged in*:disps User %col.target $+ $2 $+  not logged in (cannot summon) | halt
  185. raw 445:*summon*disabled*:disps %col.info2 $+ SUMMON command disabled | halt
  186. raw 446:*users*disabled*:disps %col.info2 $+ USERS command disabled | halt
  187. raw 461:*not enough param*:disps Not enough parameters for command %col.info2 $+ $2 | halt
  188. raw 481:*not*irc*oper*:disps Sorry, you aren't an   IRC operator   | halt
  189. raw 483:*can*t*kill*server*:disps Silly, you can't %col.info2 $+ KILL a server | halt
  190. raw 501:*unknown mode flag*:disps Unknown user mode | halt
  191. raw 502:*can*t*change*mode*other*user*:disps You cannot change or view user modes for other users | halt
  192. raw 511:*silence*full*:disps Your %col.info2 $+ SILENCE list is full, cannot add %col.target $+ $2 | halt
  193. ; -----------------------------------------------------
  194. ; Registration errors
  195. ; -----------------------------------------------------
  196. raw 451:*you have not reg*:disps $2- %col.dark $+ (possible bug in script?)
  197. raw 455:*:disps $2-7 %col.info1 $+ $8 $+  $9-12 %col.info1 $+ $13 $+  $14-18 %col.info1 $+ $19 $+  $20- | halt
  198. raw 462:*may not rereg*:disps You may %col.dark $+ not reregister | halt
  199. raw 463:*host*n*t*priv*:disps Your host is not allowed to register here | halt
  200. raw 464:*pass*incorrect*:disps Password incorrect! | halt
  201. raw 465:*you are banned*server*:return
  202. raw 484:*connection*restricted*:disps Your connection is %col.dark $+ restricted! | halt
  203. raw 491:*no*o*line*host*:disps Your host is not allowed to be an IRC operator | halt
  204. ; -----------------------------------------------------
  205. ; Nickname errors
  206. ; -----------------------------------------------------
  207. raw 431:*no nick*give*:disps No nickname given for a target | halt
  208. raw 432:*nick*:disps Invalid nickname- %col.target $+ $2 | halt
  209. raw 433:*nick*:{
  210.   if (%pp.net == offline) {
  211.     disps Nickname %col.target $+ $2 $+  already in use! Press %col.option $+ CtrlF8 to automatically take this nick when unused.
  212.     set %_cf1 whois " $+ $2"
  213.   }
  214.   else {
  215.     _disp.whois Nickname %col.target $+ $2 $+  already in use! Retrieving user info.
  216.     _disp.whois Press %col.option $+ CtrlF8 to automatically take this nick when unused.
  217.     whois " $+ $2"
  218.   }
  219.   set %_nickretake $2
  220.   halt
  221. }
  222. raw 436:*nick*collision*:_alert NICKCOLLISION Nickname collision on  $+ $2 $+  | if ($2 == $me) .raw nick Hide $+ $r(0,9) $+ $r(0,9) $+ $r(0,9) | halt
  223. raw 437:*can*t change nick*banned*chan*:dispr $2 [[ $+ %col.info1 $+ $lower($2) $+ ] Cannot change nickname- You are %col.dark $+ banned | halt
  224. raw 438:*nick*wait*:disps Change to nickname %col.target $+ $2 $+  too fast- Delaying %col.att $+ $calc($9 + 3) $+  seconds | .timer909 1 $calc($9 + 3) .raw nick $2 | halt
  225. ; -----------------------------------------------------
  226. ; Channel errors
  227. ; -----------------------------------------------------
  228. raw 484:*can*t*kick*deop*chan*service*:dispr $3 [[ $+ %col.info1 $+ $lower($3) $+ ] Cannot kick or deop %col.target $+ $2 $+ . (channel service) | halt
  229. raw 403:*no such channel*:if (%-invited. [ $+ [ $2 ] ] != $null) halt | disps [[ $+ %col.info1 $+ $lower($2) $+ ] Channel does not exist. | halt
  230. raw 404:*can*t send to chan*:{
  231.   if ($me !ison $2) disps [[ $+ %col.info1 $+ $lower($2) $+ ] Cannot send to channel %col.target $+ $2 $+ - No %col.dark $+ outside messages allowed
  232.   elseif ((m isin $gettok($chan($2).mode,1,32)) && ($me !isop $2) && ($me !isvo $2)) dispr $2 [[ $+ %col.info1 $+ $lower($2) $+ ] Cannot send to channel- %col.dark $+ Moderated
  233.   elseif ($nick != $server) dispr $2 [[ $+ %col.info1 $+ $lower($2) $+ ] Cannot send to channel- Channel is probably %col.dark $+ desynched
  234.   else dispr $2 [[ $+ %col.info1 $+ $lower($2) $+ ] Cannot send to channel- You are %col.dark $+ banned or channel may be %col.dark $+ desynched
  235.   halt
  236. }
  237. raw 405:*joined too many*:_nomrej $2 | if ($findtok(%_repjoins,$2,32)) halt | disps [[ $+ %col.info1 $+ $lower($2) $+ ] Cannot join channel- limit of %col.target $+ $chan(0) $+  channels reached | beep 1 1 | halt
  238. raw 441:*:_chands $nick o $chan $2 | disprs $3 [[ $+ %col.info1 $+ $lower($3) $+ ] %col.target $+ $2 $+  is not on channel | halt
  239. raw 442:*:_chands $nick n $chan | disps [[ $+ %col.info1 $+ $lower($2) $+ ] You are not on the channel | halt
  240. raw 443:*already on*chan*:disprs $3 [[ $+ %col.info1 $+ $lower($3) $+ ] %col.target $+ $2 $+  is already on channel (cannot invite) | halt
  241. raw 467:*key already set*:disprs $2 [[ $+ %col.info1 $+ $lower($2) $+ ] Channel key already set ( $+ %col.dark $+ $chan($2).key $+ ) | halt
  242. raw 468:*server*change mode*:disprs $2 [[ $+ %col.info1 $+ $lower($2) $+ ] Only servers can change that mode | halt
  243. raw 471:*:_nomrej $2 | if ($findtok(%_repjoins,$2,32)) halt | disps [[ $+ %col.info1 $+ $lower($2) $+ ] Cannot join channel- Channel is %col.dark $+ full (mode %col.dark $+ +l) Press %col.option $+ F10 to attempt join every 20 seconds. | set %-f10join.chan * $2 | unset %_f10dns | halt
  244. raw 472:*mode char*:disps Unknown channel mode- %col.target $+ + $+ $2 | halt
  245. raw 473:*:_nomrej $2 | if ($findtok(%_repjoins,$2,32)) halt | disps [[ $+ %col.info1 $+ $lower($2) $+ ] Cannot join channel- You must be %col.dark $+ invited (mode %col.dark $+ +i) Press %col.option $+ F10 to attempt join every 20 seconds. | set %-f10join.chan * $2 | unset %_f10dns | halt
  246. raw 474:*:_nomrej $2 | if ($findtok(%_repjoins,$2,32)) halt | disps [[ $+ %col.info1 $+ $lower($2) $+ ] Cannot join channel- You are %col.dark $+ banned (mode %col.dark $+ +b) Press %col.option $+ F10 to attempt join every 20 seconds. | set %-f10join.chan * $2 | unset %_f10dns | halt
  247. raw 477:*reg*nick*join*:_nomrej $2 | if ($findtok(%_repjoins,$2,32)) halt | disps [[ $+ %col.info1 $+ $lower($2) $+ ] Cannot join channel- You must have a %col.dark $+ registered nick (mode %col.dark $+ +R) Press %col.option $+ F10 to attempt join every 20 seconds. | set %-f10join.chan * $2 | unset %_f10dns | halt
  248. raw 475:*:{
  249.   _nomrej $2
  250.   if ($findtok(%_repjoins,$2,32)) halt
  251.   set %.key $_ppcfg(Keys,$2)
  252.   if (%.key == $null) disps [[ $+ %col.info1 $+ $lower($2) $+ ] Cannot join channel- You need the correct %col.dark $+ key (mode %col.dark $+ +k) No previous key known.
  253.   elseif (%.key == %-prevf10join.key) disps [[ $+ %col.info1 $+ $lower($2) $+ ] Cannot join channel- You need the correct %col.dark $+ key (mode %col.dark $+ +k) Stored key was incorrect.
  254.   else {
  255.     disps [[ $+ %col.info1 $+ $lower($2) $+ ] Cannot join channel- You need the correct %col.dark $+ key (mode %col.dark $+ +k)
  256.     disps [[ $+ %col.info1 $+ $lower($2) $+ ] Press %col.option $+ F10 to try joining using last known key ( $+ %col.dark $+ %.key $+ )
  257.     set %-f10join.chan $2 %.key | unset %_f10dns
  258.     halt
  259.   }
  260.   set %-f10join.chan * $2 | unset %_f10dns
  261.   disps [[ $+ %col.info1 $+ $lower($2) $+ ] Press %col.option $+ F10 to quietly attempt a join every 20 seconds.
  262.   halt
  263. }
  264. raw 478:*ban*list*:dispr $2 [[ $+ %col.info1 $+ $lower($2) $+ ] Cannot ban %col.info2 $+ $3 $+ - Ban list is %col.att $+ full | halt
  265. raw 482:*:_chands $nick o $chan | dispr $2 [[ $+ %col.info1 $+ $lower($2) $+ ] Sorry, you aren't a channel operator | halt
  266. ; -----------------------------------------------------
  267. ; MOTD
  268. ; -----------------------------------------------------
  269. raw 375:*:set %_motd.server $3 | set %_motd.file $_ppdir $+ motdtemp.txt | if ($exists(%_motd.file)) .remove %_motd.file | unset %_motd.csum | halt
  270. raw 372:*:_domotd $1- | halt
  271. raw 377:*:_domotd $1- | halt
  272. raw 378:*:_domotd $1- | halt
  273. alias -l _domotd {
  274.   if ((%_motd.file == $null) || ($nick != $server)) { disps %col.serv $+ $2- | halt }
  275.   if ((($2 == -) && ($3 == $null)) || ($2 == $null)) { write %_motd.file $chr(160) | set %_motd.csum %_motd.csum $+ . }
  276.   elseif ($2 == -) { write %_motd.file $_s2f($3-) | if (%_motd.csum == $null) set %_motd.csum $_s2c($3-) | else set %_motd.csum %_motd.csum $+ $left($3,1) $+ $right($3-,1) $+ $chr($calc($len($3-) + 33)) }
  277.   else { write %_motd.file $_s2f($2-) | if (%_motd.csum == $null) set %_motd.csum $_s2c($2-) | else set %_motd.csum %_motd.csum $+ $left($2,1) $+ $right($2-,1) $+ $chr($calc($len($2-) + 33)) }
  278. }
  279. raw 376:*:{
  280.   if ((%_motd.file == $null) || ($nick != $server)) { disps %col.serv $+ ... End Message of the day | halt }
  281.   if (@ isin %motd.route) window -c @Message
  282.   if (%-+motd.request) { unset %-+motd.request | set %.motd.why MOTD requested. | goto disp }
  283.   if ((%motd.display == off) || ($_not($exists(%_motd.file)))) { disps %col.serv $+ (message of the day skipped) | halt }
  284.   if (%motd.display == changes) {
  285.     set %.motd.old $_ppcfg(MOTD,%_motd.server)
  286.     if (%.motd.old == $null) set %.motd.why MOTD has never been viewed for this server.
  287.     elseif (%.motd.old != %_motd.csum) set %.motd.why MOTD has %col.att $+ changed %col.serv $+ since last viewing!
  288.     else { disps %col.serv $+ (message of the day has not changed- skipped) | halt }
  289.   }
  290.   else unset %.motd.why
  291.   :disp
  292.   if (@ isin %motd.route) {
  293.     open @Message
  294.     if (%.motd.why != $null) aline @Message %col.serv $+ %.motd.why
  295.     aline @Message %col.serv $+ Message of the day for [[ $+ %_motd.server $+ ]]
  296.     titlebar @Message of the day - %_motd.server
  297.   }
  298.   else {
  299.     if (%.motd.why != $null) disprs %motd.route %col.serv $+ %.motd.why
  300.     disprs %motd.route %col.serv $+ Message of the day for [[ $+ %_motd.server $+ ]]
  301.   }
  302.   _writecfg MOTD %_motd.server %_motd.csum
  303.   set %.motd.max $lines(%_motd.file)
  304.   set %.motd.line 1
  305.   :loop
  306.   if (@ isin %motd.route) aline @Message - %col.serv $+ $read -nl [ $+ [ %.motd.line ] ] %_motd.file
  307.   else disprs %motd.route - %col.serv $+ $read -nl [ $+ [ %.motd.line ] ] %_motd.file
  308.   if ($_vi(.motd.line) <= %.motd.max) goto loop
  309.   if (@ isin %motd.route) aline @Message ... %col.serv $+ End Message of the day
  310.   else disprs %motd.route ... %col.serv $+ End Message of the day
  311.   unset %_motd.*
  312.   halt
  313. }
  314. ; -----------------------------------------------------
  315. ; Server pinging/time and date
  316. ; -----------------------------------------------------
  317. raw 391:*:{
  318.   set %.sp.time %-servping. [ $+ [ $2 ] ]
  319.   set %-servping. [ $+ [ $2 ] ]
  320.   set %.sp.win $gettok(%.sp.time,2,32)
  321.   if ($left(%.sp.win,1) == !) {
  322.     set %.sp.iden $gettok(%.sp.win,1,33)
  323.     set %.sp.nick $gettok(%.sp.win,2,33)
  324.     if (%-+findping. [ $+ [ %.sp.iden ] ] == $null) halt
  325.     dispa %col.target $+ %.sp.nick $+  did %col.att $+ not leave IRC, however no reply has been received so the new nickname is unknown.
  326.     halt
  327.   }
  328.   if (%.sp.win != $null) {
  329.     if ($_not($_isopen(%.sp.win))) halt
  330.     set %.sp.time $_secs($calc($ticks - $gettok(%.sp.time,1,32)))
  331.     if (min isin %.sp.time) set %.sp.pre $_color(list) $+ ' $+ 
  332.     else unset %.sp.pre
  333.     set %.sp.line 4
  334.     :loop
  335.     set %.sp.chk $line(%.sp.win,%.sp.line)
  336.     if (%.sp.chk == $null) halt
  337.     if ($strip($gettok(%.sp.chk,3,32)) == $2) {
  338.       rline %.sp.win %.sp.line $gettok(%.sp.chk,1-6,32) ( $+ %.sp.pre $+ %col.addr $+ %.sp.time $+  ping) $gettok(%.sp.chk,9-,32)
  339.       halt
  340.     }
  341.     inc %.sp.line
  342.     goto loop
  343.   }
  344.   elseif (%.sp.time != $null) {
  345.     disps Server Ping reply of %col.info1 $+ $_secs($calc($ticks - %.sp.time)) $+  from %col.info2 $+ $2
  346.     halt
  347.   }
  348.   disps Date/time at %col.info2 $+ $2 $+  - %col.dark $+ $3-
  349.   halt
  350. }
  351. ; -----------------------------------------------------
  352. ; Channel banlist window
  353. ; -----------------------------------------------------
  354. #-banlist off
  355. raw 367:*:inc %-bancount | if ($4 == $null) aline @Banlist %col.att $+ *b     $+ $3 | else aline @Banlist %col.att $+ *b     $+ $3 $+      $+ %col.target $+ $4 $+      $+  $+ $asctime($5) $+      $+ %col.misc $+ $_round($calc(($ctime - $5) / 86400),2) days | halt
  356. #-banlist end
  357. raw 367:*:window -c @Banlist | window -ln $+ $_spec1d $_tabscale(2,25,42,57) @Banlist $_winpos(14%,7%,8%,8%) @Banlist %font.basic | set %-bancount 1 | .enable #-banlist | if ($4 == $null) aline @Banlist %col.att $+ *b     $+ $3 | else aline @Banlist %col.att $+ *b     $+ $3 $+      $+ %col.target $+ $4 $+      $+  $+ $asctime($5) $+      $+ %col.misc $+ $_round($calc(($ctime - $5) / 86400),2) days | halt
  358. raw 368:*:{
  359.   if ((%-bancount < 1) || ($_not($_isopen(@Banlist)))) {
  360.     set %-bancount 0
  361.     window -c @Banlist
  362.     window -ln $+ $_spec1d $_tabscale(2,25,42,57) @Banlist $_winpos(14%,7%,8%,8%) @Banlist %font.basic
  363.   }
  364.   titlebar @Banlist for $2 - %-bancount $_plural(ban,%-bancount)
  365.   iline @Banlist 1 Double-click on a ban to remove or cancel removal. Right-click for other options.
  366.   iline @Banlist 2 Changes will not be made until you close the window.
  367.   iline @Banlist 3 $chr(160)
  368.   iline @Banlist 4      Ban      Set by      Set on      Age 
  369.   window -abr @Banlist
  370.   set %_bancount %-bancount
  371.   set %_banchan $2
  372.   unset %-bancount %_banadds %_banrems %_bantoadd %_bantorem
  373.   .disable #-banlist
  374.   halt
  375. }
  376. ; -----------------------------------------------------
  377. ; Port scan
  378. ; -----------------------------------------------------
  379. raw 211:*send*send*open*:{
  380.   unset %-port.speed %-port.serv
  381.   window -c @Ports
  382.   window -l $+ $_spec1d @Ports $_winpos(7%,7%,5%,20%) @Ports %font.basic
  383.   .enable #-portscan
  384.   halt
  385. }
  386. raw 211:*:{
  387.   if ($window(@Ports) == $null) {
  388.     unset %-port.speed %-port.serv
  389.     window -l $+ $_spec1d @Ports $_winpos(7%,7%,5%,20%) @Ports %font.basic
  390.     .enable #-portscan
  391.   }
  392.   if (%-port.serv == $null) {
  393.     set %-port.serv $gettok($2,1,91)
  394.     if (%-port.serv == $server) titlebar @Ports for %-port.serv (currently on $port $+ )
  395.     else titlebar @Ports for %-port.serv (currently on another server)
  396.   }
  397.   if ($gettok($2,1,91) != %-port.serv) halt
  398.   set %.port $remove($_rtok(1,46,$gettok($2,2,91)),])
  399.   if (%.port == $null) halt
  400.   if (%.port !isin 1024.4444000.4401.4402.6666000.6661.6662.6663.6664.6665.6667.6668.6669.6670.7777000.7001.7002.8888000) set %.warn %col.att $+ (port may not be for public use)
  401.   else unset %.warn
  402.   set %.speed $calc($5 + $7)
  403.   unset %.switch
  404.   if ((%.warn == $null) && ((%.speed < %-port.speed) || (%-port.speed == $null))) { set %-port.speed %.speed | set %.switch -s }
  405.   set %.line 1
  406.   :loop
  407.   if (%.line <= $line(@ports,0)) {
  408.     if ($strip($gettok($gettok($line(@Ports,%.line),4,32),1,75)) < %.speed) { inc %.line | goto loop }
  409.   }
  410.   iline %.switch @Ports %.line Port %col.target $+ [[ $+ %.port $+ ] -> %col.info1 $+ %.speed $+ KB sent/received %.warn
  411.   halt
  412. }
  413. #-portscan off
  414. raw 219:*:{
  415.   .disable #-portscan
  416.   iline @Ports 1 Found %col.target $+ $line(@Ports,0) $+  active ports on %col.info1 $+ %-port.serv
  417.   iline @Ports 2 Currently sorted by speed (fastest ports first)
  418.   iline @Ports 3 Double click to connect to a port, right-click for options
  419.   iline @Ports 4 $chr(160)
  420.   unset %_port.pop1
  421.   set %_port.pop2 Sort by port number
  422.   halt
  423. }
  424. #-portscan end
  425. on 1:disconnect:if ($_isopen(@ports)) titlebar @Ports $gettok($window(@ports).titlebar,1-2,32)
  426. on 1:connect:{
  427.   if ($_isopen(@ports)) {
  428.     set %.po.serv $gettok($window(@ports).titlebar,2,32)
  429.     if ($server == %.po.serv) titlebar @Ports for %.po.serv (currently on $port $+ )
  430.     else titlebar @Ports for %.po.serv (currently on another server)
  431.   }
  432. }
  433. ; -----------------------------------------------------
  434. ; "Nearby" server collection
  435. ; -----------------------------------------------------
  436. #-nearserv off
  437. raw 364:*:if (($4 >= %-ns.min) && ($4 <= %-ns.max)) { set %_ns.found %_ns.found $2 | dispa $chr(160) ò %col.info2 $+ $2 } | halt
  438. raw 365:*:.disable #-nearserv | if (%_ns.found == $null) dispa No servers found matching criteria. | else { dispa Found %col.target $+ $_numtok(32,%_ns.found) $+  matching servers. Press %col.option $+ ShiftF9 to connect to one randomly. | set %_sf9.server * } | halt
  439. #-nearserv end
  440. ; -----------------------------------------------------
  441. ; Colored nicks/userhost stuff
  442. ; -----------------------------------------------------
  443. raw 352:*:if (($_not(%+nickcolors)) || ($me !ison $2)) halt | _nickcol $6 $3 $+ @ $+ $4 $6 $+ ! $+ $3 $+ @ $+ $4 $7 | halt
  444. raw 302:*:{
  445.   if (($2 == $3) && ($2 != $null)) { unset %-uhsearch %-userhostc?.* | halt }
  446.   set %.target $gettok(%-uhsearch,1,32)
  447.   set %-uhsearch $gettok(%-uhsearch,2-,32)
  448.   if (%.target == .clean) halt
  449.   if (%.target == .nick) {
  450.     if ($2 == $null) {
  451.       if (%_nickretake != $null) { dispa Nickname %col.target $+ %_nickretake $+  no longer in use. Changing to nick... | nick %_nickretake }
  452.       .timer903 off | unset %_nickretake %_+nickrc
  453.     }
  454.     if ($gettok($2,2,64) == $gettok(%-my.address,2,64)) set %.ghost (ghost) | else unset %.ghost
  455.     if (((%_+nickdal) && (%.ghost != $null)) || (%_+nickkill)) {
  456.       set %.pw %autonk. [ $+ [ %_nickretake ] ]
  457.       if (%.ghost != $null) { set %.ghost ghost | dispa Performing automatic NickServ KILL on %col.target $+ %_nickretake $+ ... (ghost detected) }
  458.       else { set %.ghost recover | dispa NickServ will release nick in two minutes; Press %col.option $+ CtrlF8 again to release early. | set %_+nickrecv $true }
  459.       ns %.ghost %_nickretake $_pwenc(%.pw)
  460.       unset %_+nickkill %_+nickdal
  461.     }
  462.     halt
  463.   }
  464.   if ((%.target == .group) || (%.target == $null)) {
  465.     if ($2 == $null) halt
  466.   }
  467.   else {
  468.     if ($2 == $null) {
  469.       set %-userhostc1. [ $+ [ %.target ] ]
  470.       set %-userhostc2. [ $+ [ %.target ] ]
  471.       _error Address search failed- No such user  $+ %.target $+ 
  472.     }
  473.     set %.tmp $remove($gettok($2,1,61),*)
  474.     if (%-userhostc1. [ $+ [ %.tmp ] ] != $null) {
  475.       set %.mask %.tmp $+ ! $+ $_rchop(1,$gettok($2,2,61))
  476.       set %.type %-userhostc2. [ $+ [ %.tmp ] ]
  477.       if (%.type isnum) set %.mask $_ppmask(%.mask,%.type)
  478.       elseif (%.type == *) set %.mask $mask(%.mask,3)
  479.       set %.cmd %-userhostc1. [ $+ [ %.tmp ] ]
  480.       set %-userhostc1. [ $+ [ %.tmp ] ]
  481.       set %-userhostc2. [ $+ [ %.tmp ] ]
  482.       $reptok(%.cmd,$chr(44),%.mask,32)
  483.       halt
  484.     }
  485.   }
  486.   set %.uh.num $_numtok(32,$2-)
  487.   :loopuh
  488.   set %.uh.cur $gettok($2-,%.uh.num,32)
  489.   set %.wr.nick $remove($gettok(%.uh.cur,1,61),*)
  490.   set %.wr.addr %.wr.nick $+ ! $+ $_rchop(1,$gettok(%.uh.cur,2,61))
  491.   if ($findtok(%-notifychk,%.wr.nick,32) != $null) {
  492.     set %-notifychk $remtok(%-notifychk,%.wr.nick,32)
  493.     _runnotify %.wr.nick %.wr.addr $left($gettok(%.uh.cur,2,61),1)
  494.   }
  495.   set %.wr.lvl $level($maddress(%.wr.addr))
  496.   if ((%+ircop.check) && (* isin $gettok(%.uh.cur,1,61))) {
  497.     set %.ic.chan $comchan(%.wr.nick,0)
  498.     if ((%.ic.chan > 0) && ($me != %.wr.nick)) {
  499.       set %.ic.chan $comchan(%.wr.nick,%.ic.chan)
  500.       disprs %.ic.chan [[ $+ %col.info1 $+ %.ic.chan $+ ] Warning- %col.target $+ %.wr.nick $+  is an   IRCop  
  501.       if (%+nickcolors) _updncol %.wr.nick %col.nicki
  502.     }
  503.   }
  504.   if ($_vd(.uh.num) > 0) goto loopuh
  505.   halt
  506. }
  507. ; -----------------------------------------------------
  508. raw 1:*:halt
  509. raw 5:*:return
  510. raw 7:*:return
  511. raw 301:*:halt
  512. raw 303:*:halt
  513. raw 305:*:halt
  514. raw 306:*:halt
  515. raw 307:*:if (= !isin $2) halt | disps UserIP: $2- | halt
  516. raw 308:*:halt
  517. raw 309:*:halt
  518. raw 310:*:halt
  519. raw 311:*:halt
  520. raw 312:*:halt
  521. raw 313:*:halt
  522. raw 314:*:halt
  523. raw 315:*:halt
  524. raw 317:*:halt
  525. raw 318:*:halt
  526. raw 319:*:halt
  527. raw 321:*:return
  528. raw 322:*:return
  529. raw 323:*:return
  530. raw 354:*:halt
  531. raw 364:*:return
  532. raw 365:*:return
  533. raw 369:*:halt
  534. raw 401:*:halt
  535. raw 406:*:halt
  536. raw *:*:if ($nick != $server) set %.raw.serv %col.att $+ $nick $+  | else unset %.raw.serv | if ($1 == $me) disps %.raw.serv %col.dark $+ ( $+ $numeric $+ ) $2- | else disps %.raw.serv %col.dark $+ ( $+ $numeric $+ : $+ $1 $+ ) $2- | halt
  537.